﻿using Developer.Service;
using Super.Framework.Common;
using Super.Framework.Common.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Developer.Web.Controllers
{
    public class JOrderController : BaseController
    {
        public ActionResult SearchOrder()
        {
            return View();
        }
        [HttpPost]
        public ActionResult SearchOrder(int? z)
        {
            var key = Query.Value("key");
            var project = Query.Value("project").ToInt();
            switch (project)
            {
                case 0: ViewBag.result = RepairOrderDetailService.GetAll().Where(a => a.UserPhone == key);
                    break;
                case 1: ViewBag.result = CycleOrderDetailService.GetAll().Where(a => a.UserPhone == key);
                    break;
            }
            ViewBag.project = project;
            return View();
        }
    }
}